package com.feilong.edgeAI.ui;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;

import com.aiibt.common.core.WDActivity;
import com.aiibt.common.util.Constant;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.blankj.utilcode.util.AppUtils;
import com.feilong.edgeAI.R;
import com.feilong.edgeAI.databinding.ActivityAboutBinding;
import com.feilong.edgeAI.model.TestUpdate;
import com.feilong.edgeAI.model.UpdateApp;
import com.feilong.edgeAI.vm.AboutViewModel;

import org.greenrobot.eventbus.EventBus;

/**
 * Created by【仿脑科技】
 *About界面
 * @Author: potato
 * @CreateDate: 2023/12/20 14:56
 */

@Route(path = Constant.ACTIVITY_URL_ABOUT)
public class AboutActivity extends WDActivity<AboutViewModel, ActivityAboutBinding> {
    private static final String TAG = "AboutActivity";
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding.versionName.setText(AppUtils.getAppVersionName());


        binding.layoutVersion.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                viewModel.requestLastVersion(AboutActivity.this,true);
            }
        });
        binding.layoutVersion.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View v) {
                EventBus.getDefault().post(new UpdateApp());
                return true;
            }
        });
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_about;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {

    }
}
